package queue;

import java.util.LinkedList;

/**
 * @description: 用队列模拟栈的行为
 * @author: caoyihong
 * @date: 2025-10-11 11:26
 * @Version 1.0
 **/
public class StackExample {
    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<>();
        // 入栈
        list.addFirst("A");
        // 出栈
        String item = list.removeFirst();
        // 查看栈顶元素
        String first = list.peekFirst();
        // 判断栈是否为空
        list.isEmpty();
    }
}
